<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <meta http-equiv="X-UA-Compatible" content="IE=edge" >
  <title>starkshang</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description">
<meta property="og:type" content="website">
<meta property="og:title" content="starkshang">
<meta property="og:url" content="http://yoursite.com/index.html">
<meta property="og:site_name" content="starkshang">
<meta property="og:description">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="starkshang">
<meta name="twitter:description">
  
    <link rel="alternative" href="/atom.xml" title="starkshang" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  <link rel="stylesheet" href="/css/style.css" type="text/css">
</head>

<body>
  <div id="container">
    <div class="left-col">
    <div class="overlay"></div>
<div class="intrude-less">
	<header id="header" class="inner">
		<a href="/" class="profilepic">
			
			<img lazy-src="http://7xpoty.com1.z0.glb.clouddn.com/%E5%AF%86%E7%8D%BE2.png" class="js-avatar">
			
		</a>

		<hgroup>
		  <h1 class="header-author"><a href="/">starkshang</a></h1>
		</hgroup>

		
		<p class="header-subtitle">Since you want to do,why not now?</p>
		

		
			<div class="switch-btn">
				<div class="icon">
					<div class="icon-ctn">
						<div class="icon-wrap icon-house" data-idx="0">
							<div class="birdhouse"></div>
							<div class="birdhouse_holes"></div>
						</div>
						<div class="icon-wrap icon-ribbon hide" data-idx="1">
							<div class="ribbon"></div>
						</div>
						
						
						<div class="icon-wrap icon-me hide" data-idx="3">
							<div class="user"></div>
							<div class="shoulder"></div>
						</div>
						
					</div>
					
				</div>
				<div class="tips-box hide">
					<div class="tips-arrow"></div>
					<ul class="tips-inner">
						<li>菜单</li>
						<li>标签</li>
						
						
						<li>关于我</li>
						
					</ul>
				</div>
			</div>
		

		<div class="switch-area">
			<div class="switch-wrap">
				<section class="switch-part switch-part1">
					<nav class="header-menu">
						<ul>
						
							<li><a href="/">主页</a></li>
				        
							<li><a href="/archives">所有文章</a></li>
				        
						</ul>
					</nav>
					<nav class="header-nav">
						<div class="social">
							
								<a class="github" target="_blank" href="https://github.com/mingyangShang" title="github">github</a>
					        
								<a class="zhihu" target="_blank" href="https://www.zhihu.com/people/shang-ming-yang-54" title="zhihu">zhihu</a>
					        
								<a class="facebook" target="_blank" href="https://www.facebook.com/profile.php?id=100010973622690" title="facebook">facebook</a>
					        
								<a class="google" target="_blank" href="/shangmingyanggo@gmail.com" title="google">google</a>
					        
						</div>
					</nav>
				</section>
				
				
				<section class="switch-part switch-part2">
					<div class="widget tagcloud" id="js-tagcloud">
						<a href="/tags/RTMP/" style="font-size: 10px;">RTMP</a> <a href="/tags/java/" style="font-size: 16.67px;">java</a> <a href="/tags/协议/" style="font-size: 10px;">协议</a> <a href="/tags/并发编程/" style="font-size: 16.67px;">并发编程</a> <a href="/tags/收藏/" style="font-size: 10px;">收藏</a> <a href="/tags/读书笔记/" style="font-size: 20px;">读书笔记</a> <a href="/tags/随笔/" style="font-size: 13.33px;">随笔</a>
					</div>
				</section>
				
				
				

				
				
				<section class="switch-part switch-part3">
				
					<div id="js-aboutme">大连理工大学本科毕业，曾为阿里巴巴天猫无线实习生、腾讯MIG职实习生。熟悉android 开发，爱读书、爱打台球、爱技术，崇尚简洁的美。干自己该干的事，做自己想做的人。</div>
				</section>
				
			</div>
		</div>
	</header>				
</div>

    </div>
    <div class="mid-col">
      <nav id="mobile-nav">
  	<div class="overlay">
  		<div class="slider-trigger"></div>
  		<h1 class="header-author js-mobile-header hide">starkshang</h1>
  	</div>
	<div class="intrude-less">
		<header id="header" class="inner">
			<div class="profilepic">
			
				<img lazy-src="http://7xpoty.com1.z0.glb.clouddn.com/%E5%AF%86%E7%8D%BE2.png" class="js-avatar">
			
			</div>
			<hgroup>
			  <h1 class="header-author">starkshang</h1>
			</hgroup>
			
			<p class="header-subtitle">Since you want to do,why not now?</p>
			
			<nav class="header-menu">
				<ul>
				
					<li><a href="/">主页</a></li>
		        
					<li><a href="/archives">所有文章</a></li>
		        
		        <div class="clearfix"></div>
				</ul>
			</nav>
			<nav class="header-nav">
				<div class="social">
					
						<a class="github" target="_blank" href="https://github.com/mingyangShang" title="github">github</a>
			        
						<a class="zhihu" target="_blank" href="https://www.zhihu.com/people/shang-ming-yang-54" title="zhihu">zhihu</a>
			        
						<a class="facebook" target="_blank" href="https://www.facebook.com/profile.php?id=100010973622690" title="facebook">facebook</a>
			        
						<a class="google" target="_blank" href="/shangmingyanggo@gmail.com" title="google">google</a>
			        
				</div>
			</nav>
		</header>				
	</div>
</nav>

      <div class="body-wrap">
  
    <article id="post-分享一首美丽的诗－如果有来生" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2016/03/28/分享一首美丽的诗－如果有来生/" class="article-date">
  	<time datetime="2016-03-28T10:00:00.000Z" itemprop="datePublished">2016-03-28</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2016/03/28/分享一首美丽的诗－如果有来生/">分享一首美丽的诗－如果有来生</a>
    </h1>
  

      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;偶然间读到了这首诗，一下子就被惊艳到了。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这首诗其实并不是一个人所作，也并不是三毛、海子和姜岩的合作，而是网上某名才子从三人作品中摘抄出来的，形式上看上去虽然不是那么整齐，但读完给人的感受却是一样的凄凉，一样的美丽。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;三毛、海子和姜岩，三人都是现代文坛的才子佳人，但却都因各自种种的原因选择了自杀。或许是他们对生活太过于悲观，或许是因为它们把人生看的更加透彻，如果有来生，不知他们又会作何选择，还活着的我们又该怎么走剩下的路呢</p>
<center><img src="http://7xpoty.com1.z0.glb.clouddn.com/tree.jpg" alt=""></center><br>
      
    </div>
    
    <div class="article-info article-info-index">
      
      
	<div class="article-tag tagcloud">
		<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/收藏/">收藏</a></li></ul>
	</div>

      

      
        <p class="article-more-link">
          <a  href="/2016/03/28/分享一首美丽的诗－如果有来生/#more">more >></a>
        </p>
      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>









  
    <article id="post-RTMP协议" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2016/03/06/RTMP协议/" class="article-date">
  	<time datetime="2016-03-06T11:26:00.000Z" itemprop="datePublished">2016-03-06</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2016/03/06/RTMP协议/">带你吃透RTMP</a>
    </h1>
  

      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <p><i>博客已迁到简书，有兴趣的朋友可以移至<a href="https://www.jianshu.com/p/b2144f9bbe28">这里</a></i> <br></p>
<p>RTMP协议是Real Time Message Protocol(实时信息传输协议)的缩写，它是由Adobe公司提出的一种应用层的协议，用来解决多媒体数据传输流的多路复用（Multiplexing）和分包（packetizing）的问题。随着VR技术的发展，视频直播等领域逐渐活跃起来，RTMP作为业内广泛使用的协议也重新被相关开发者重视起来。正好最近在从事这方面的工作，在此记录下自己对RTMP的理解，文章内容多翻译自英文版RTMP文档，按照本人的理解重新整理，希望可以帮助想要了解RTMP协议的朋友，也方面自己日后查阅。<br>
      
    </div>
    
    <div class="article-info article-info-index">
      
      
	<div class="article-tag tagcloud">
		<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/RTMP/">RTMP</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/协议/">协议</a></li></ul>
	</div>

      

      
        <p class="article-more-link">
          <a  href="/2016/03/06/RTMP协议/#more">more >></a>
        </p>
      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>









  
    <article id="post-并发编程之多线程执行篇" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2016/01/16/并发编程之多线程执行篇/" class="article-date">
  	<time datetime="2016-01-15T17:00:00.000Z" itemprop="datePublished">2016-01-16</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2016/01/16/并发编程之多线程执行篇/">并发编程之多线程执行篇</a>
    </h1>
  

      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>多线程执行任务，核心就在于如何划分任务，如何管理执行任务的多个线程，用公式化的形式表示就是<strong>多线程执行任务＝清晰的任务边界＋明确的任务执行策略</strong></p>
<p>如何确定任务，什么样的任务才可以被放到单独的一个或者一组线程执行，这就需要明确任务的边界。我们希望任务之间尽量没有依赖关系，最好是相互独立的，这样一旦资源充分可用时，它们可以同时被执行，发挥并行的最大效果。同时这也就要求对问题要有着清晰的认识，要能从问题中挖掘出子问题；还要控制好任务的粒度，保证并行化任务节省时间大于线程开销。以大多数网站服务器程序为例，每一个客户请求是独立的，同一时刻可能存在大量的请求，那么每一个客户请求就可以被视为一个任务。<br>
      
    </div>
    
    <div class="article-info article-info-index">
      
      
	<div class="article-tag tagcloud">
		<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/java/">java</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/并发编程/">并发编程</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/读书笔记/">读书笔记</a></li></ul>
	</div>

      

      
        <p class="article-more-link">
          <a  href="/2016/01/16/并发编程之多线程执行篇/#more">more >></a>
        </p>
      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>









  
    <article id="post-微信引发的思考" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2016/01/11/微信引发的思考/" class="article-date">
  	<time datetime="2016-01-11T10:00:00.000Z" itemprop="datePublished">2016-01-11</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2016/01/11/微信引发的思考/">微信引发的思考</a>
    </h1>
  

      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <p><img src="http://img1.gtimg.com/tech/pics/hv1/196/167/2002/130222831.jpg" alt=""><br>今天张小龙的<a href="http://tech.qq.com/a/20160111/034681.htm">首次公开演讲文章</a>被各种转发,反复地读了几遍，不禁对腾讯人的敬佩又深了几分。文章不长，但从中体现出的张小龙以及他所带领的微信团队的价值观、他们对产品的认识和思考问题的方式，也让我引发了自己的一些思考。<br>
      
    </div>
    
    <div class="article-info article-info-index">
      
      
	<div class="article-tag tagcloud">
		<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/随笔/">随笔</a></li></ul>
	</div>

      

      
        <p class="article-more-link">
          <a  href="/2016/01/11/微信引发的思考/#more">more >></a>
        </p>
      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>









  
    <article id="post-并发编程之同步互斥篇" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2016/01/10/并发编程之同步互斥篇/" class="article-date">
  	<time datetime="2016-01-10T04:00:00.000Z" itemprop="datePublished">2016-01-10</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2016/01/10/并发编程之同步互斥篇/">并发编程之同步互斥篇</a>
    </h1>
  

      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>在<a href="https://mingyangshang.github.io/2016/01/09/%E5%B9%B6%E5%8F%91%E7%BC%96%E7%A8%8B/">并发编程之基础问答篇</a>中我对并发编程的概念、优势、应用场景、注意事项等做了整体上的大概介绍，文章最后提出了我从实际编程的角度对并发编程的理解：多线程的并发执行，线程间的通信和线程间对共享状态的同步与互斥。虽然说多线程并发执行是另外两方面的基础，但线程间对共享状态的同步互斥是并发编程的正确性保障，也会在另外两方面的讲解和例子中大量用到，再者鉴于本系列博客的期望读者是已经掌握并发编程最最基本使用的开发者（知道Runnable，Thread创建线程就好），因此在这三方面中我将首先介绍第三点：线程间对共享可变状态的同步与互斥。<br>
      
    </div>
    
    <div class="article-info article-info-index">
      
      
	<div class="article-tag tagcloud">
		<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/java/">java</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/并发编程/">并发编程</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/读书笔记/">读书笔记</a></li></ul>
	</div>

      

      
        <p class="article-more-link">
          <a  href="/2016/01/10/并发编程之同步互斥篇/#more">more >></a>
        </p>
      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>









  
    <article id="post-并发编程" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2016/01/09/并发编程/" class="article-date">
  	<time datetime="2016-01-09T08:00:00.000Z" itemprop="datePublished">2016-01-09</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2016/01/09/并发编程/">并发编程之基础问答篇</a>
    </h1>
  

      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>并发是计算机编程中非常重要的一个概念，其中涉及了许多高级技巧和模式，对于一个优秀的程序猿来说掌握好并发编程是一门必修课，接下来的几篇文章我将就我自己对并发编程的一些看法和实践经验对这方面进行一下梳理和总结，欢迎各路大神批评指正，大家在交流中共同进步～～<br>
      
    </div>
    
    <div class="article-info article-info-index">
      
      
	<div class="article-tag tagcloud">
		<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/java/">java</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/并发编程/">并发编程</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/读书笔记/">读书笔记</a></li></ul>
	</div>

      

      
        <p class="article-more-link">
          <a  href="/2016/01/09/并发编程/#more">more >></a>
        </p>
      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>









  
    <article id="post-编程珠玑" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2016/01/01/编程珠玑/" class="article-date">
  	<time datetime="2016-01-01T04:30:00.000Z" itemprop="datePublished">2016-01-01</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2016/01/01/编程珠玑/">编程珠玑</a>
    </h1>
  

      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <p><i>博客已迁到简书，有兴趣的朋友可以移至<a href="https://www.jianshu.com/p/f23e5fe79a47">这里</a></i> <br></p>
<p>这不是一本具体算法的讲解或者代码编写的教程，但是从书中的字里行间，我们可以学到的是更多的<strong>软知识</strong>:<strong>对编程新的认识、更加发散的思维方式、更严格的代码要求、堪比瑞士军刀的小技巧</strong>…… 编程也许入门并不难，但是要想真正成为一名优秀的软件工程师，还是需要很多锤炼。<strong>内外兼修，方成大器。</strong><br>
      
    </div>
    
    <div class="article-info article-info-index">
      
      
	<div class="article-tag tagcloud">
		<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/读书笔记/">读书笔记</a></li></ul>
	</div>

      

      
        <p class="article-more-link">
          <a  href="/2016/01/01/编程珠玑/#more">more >></a>
        </p>
      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>









  
    <article id="post-今天的2015，明天的2016" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2015/12/31/今天的2015，明天的2016/" class="article-date">
  	<time datetime="2015-12-31T14:30:48.000Z" itemprop="datePublished">2015-12-31</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2015/12/31/今天的2015，明天的2016/">今天的2015，明天的2016</a>
    </h1>
  

      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>搭建这个个人博客的时间刚好是2015年的最后一天，回首这一年发生的点点滴滴，确实值得自己用文字记述下来，对今年的回顾、对明年的展望，所有的经历，快乐的或是痛苦的，都是为了梦想而付出的努力，2016，相信自己会更好！<br>
      
    </div>
    
    <div class="article-info article-info-index">
      
      
	<div class="article-tag tagcloud">
		<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/随笔/">随笔</a></li></ul>
	</div>

      

      
        <p class="article-more-link">
          <a  href="/2015/12/31/今天的2015，明天的2016/#more">more >></a>
        </p>
      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>









  
  
</div>
      <footer id="footer">
  <div class="outer">
    <div id="footer-info">
    	<div class="footer-left">
    		&copy; 2019 starkshang
    	</div>
      	<div class="footer-right">
      		<a href="http://hexo.io/" target="_blank">Hexo</a>  Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten
      	</div>
    </div>
  </div>
</footer>
    </div>
    
  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css" type="text/css">


<script>
	var yiliaConfig = {
		fancybox: true,
		mathjax: true,
		animate: true,
		isHome: true,
		isPost: false,
		isArchive: false,
		isTag: false,
		isCategory: false,
		open_in_new: false
	}
</script>
<script src="https://7.url.cn/edu/jslib/comb/require-2.1.6,jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="/js/main.js" type="text/javascript"></script>






<script type="text/x-mathjax-config">
MathJax.Hub.Config({
    tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
        processEscapes: true,
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    }
});

MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
        all[i].SourceElement().parentNode.className += ' has-jax';                 
    }       
});
</script>

<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>


  </div>
</body>
</html>